
package com.et.easy.demo.mockito;

import java.util.List;
import static org.mockito.Mockito.*;

/**
 * <p>Mockito BDD</p>
 * @author defier Lai
 * <p>Date: 2009-11-1 下午01:39:49</p>
 * @version 1.0
 */
public class MockitoDemo {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		List mockedList = mock(List.class);
		mockedList.add("one");
		mockedList.clear();
		
		verify(mockedList).add("one");
		verify(mockedList).clear();
		
		when(mockedList.get(0)).thenReturn("first");
		when(mockedList.get(999)).thenReturn("999");
		
		System.out.println(mockedList.get(0));
		System.out.println(mockedList.get(999));
		
	}
	
}
